<template>
	<view class="container">
		<view>
			<desc-wrapper :title="title" :desc="desc"></desc-wrapper>
			<z-card justifyContent="center">
				<view class="card-content-item">
					<text class="card-content-label_left">您的姓氏</text>
					<view class="card-content_right">
						<view class="input-name-box">
							<input class="input-item" v-model="form.surname" type="text" placeholder="请输入您的姓氏" />
						</view>
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left">您的性别</text>
					<view class="card-content_right">
						<uni-data-checkbox selectedColor="#4e6542" selectedTextColor="#333" v-model="form.sex"
							:localdata="genders" @change="sexChange"></uni-data-checkbox>
					</view>
				</view>
			</z-card>
			<view class="bottom-btns">
				<view class="start-btn" @click="onClick_1">
					<text class="">立即起名</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '在线起名',
				desc: '测试方法：输入您的姓，暂时只支持简体字查询，点击立即起名，并查看测算结果，请自行体会其中的指示',
				form: {
					surname: '',
					sex: 0,
					page: 1,
					limit: 150,
				},
				genders: [{
						value: 0,
						text: '男\b'
					},
					{
						value: 1,
						text: '女\b'
					},
					{
						value: 2,
						text: '不限'
					}
				],
			};
		},
		methods: {
			//切换性别触发
			sexChange(e) {
				this.form.sex = e.detail.value
				console.log('e:', e)
			},
			onClick_1() {
				let that = this;
				if (this.form.surname == "") {
					uni.$u.toast("请输入您的姓氏")
					return
				}
				uni.navigateTo({
					url: `/pages/makename/detail?formData=${ JSON.stringify(this.form)}`
				})
			},
		},
	};
</script>
<style lang="scss">
</style>